import React from 'react'
import { Tabs } from 'antd';

import { salaryType } from '../paramMap';

const { TabPane } = Tabs

const useTab = (configList, tabsVal, changeTab) => ({
        render() {
            return (
                <Tabs size="large" activeKey={tabsVal} onChange={changeTab}>
                    {
                        Object.entries(salaryType).map(([key, value]) => (
                            <TabPane tab={`${value}（${configList.filter(item => item.parentGlobalType === key).length}）`} key={key} />
                        ))
                    }
                </Tabs>
            );
        }
    });

export default useTab;
